﻿@{
    Layout = "~/Views/Shared/_LayoutBase.cshtml";

    ViewBag.Title = "系统登录";
}

<style type="text/css">
    #footer {
        color: #fff;
        height: 20px;
        background: #000;
        padding-top: 5px;
        text-align: center;
        font-family: Georgia;
    }

    #main {
        padding: 10px;
        background-color: #2a9ac9;
    }

    #tbLogin {
        width: 100%;
        border-collapse: collapse;
    }

        #tbLogin tr th, #tbLogin tr td {
            padding: 5px;
            border: solid 1px #ccc;
        }

        #tbLogin tr th {
            text-align: right;
            background-color: #eee;
        }

    .input_1 {
        font-size: 16px;
        line-height: 16px;
        height: 25px;
        width: 200px;
        border-top: none;
        border-left: none;
        border-right: none;
        padding-left: 5px;
    }
</style>

<script type="text/javascript">
    var frmLogin;
    $(function () {
        frmLogin = $('#frmLogin').form({
            url: "/Home/LoginSubmit",
            success: function (data) {
                data = $.parseJSON(data);
                console.info(data);
                if (data && data.success) {
                    $.messager.show({
                        title: '提示',
                        msg: data.msg
                    });
                }
            }
        });

        $('#loginDialog').show().dialog({
            modal: false,
            closable: false,
            iconCls: 'icon-box',
            buttons: [{
                id: 'loginBtn',
                text: '登录',
                iconCls: 'icon-ok',
                handler: function () {
                    frmLogin.submit();
                }
            }],
            onOpen: function () {
                $('form :input:first').focus();
                $('form :input').keyup(function (event) {
                    if (event.keyCode == 13) {
                        frmLogin.submit();
                    }
                });
            }
        });
    });
</script>

<body class="easyui-layout">
    <div id="main" data-options="region:'center',title:''">
        <div id="loginDialog" title="XXX管理系统" style="width:350px;height:200px;padding:0px;overflow:hidden;">
            <div id="loginTabs" class="easyui-tabs" data-options="fit:true,border:false,toolPosition:'right'">
                <div title="系统登录" style="overflow: hidden; padding: 10px;" data-options="iconCls:'icon-key'">
                    <form id="frmLogin" method="post">
                        <table id="tbLogin">
                            <tr>
                                <th style="width:70px;">用户名</th>
                                <td><input type="text" class="easyui-validatebox input_1" data-options="required:true" name="username" /></td>
                            </tr>
                            <tr>
                                <th>密码</th>
                                <td><input type="password" class="easyui-validatebox input_1" data-options="required:true" name="password" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div id="footer" data-options="region:'south',border:false">
        XXX版权所有 &copy; 2014
    </div>
</body>